import 'package:flutter/material.dart';

class ImagePage extends StatefulWidget {
  @override
  _ImagePageState createState() {
    return new _ImagePageState();
  }
}

class _ImagePageState extends State<ImagePage> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
        appBar: new AppBar(
          title: Text('图片，Icon'),
        ),
        body: ListView(
          children: [
            Container(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text('Image', style: TextStyle(fontSize: 30)),
                  Column(
                    children: [
                      Text(
                        '本地图片',
                        textAlign: TextAlign.left,
                      ),
                      Image(
                        image: AssetImage("images/test.jpeg"),
                      )
                    ],
                  ),
                  Column(
                    children: [
                      Text(
                        '网络图片',
                        textAlign: TextAlign.left,
                      ),
                      Image.network(
                          'https://data.znds.com/attachment/forum/201606/09/175335zfpffn9n01g6e7z4.jpg'),
                    ],
                  ),
                  Row(
                    children: [
                      Image(
                          image: AssetImage("images/test.jpeg"),
                          width: 100,
                          height: 100,
                          fit: BoxFit.cover),
                      Text('带样式的本地图片', textAlign: TextAlign.left),
                    ],
                  ),
                  Row(
                    children: [
                      Image(
                          image: AssetImage("images/test.jpeg"),
                          width: 100,
                          height: 100,
                          fit: BoxFit.cover),
                      Text('BoxFit.cover', textAlign: TextAlign.left),
                    ],
                  ),
                  Row(
                    children: [
                      Image(
                          image: AssetImage("images/test.jpeg"),
                          width: 100,
                          height: 100,
                          fit: BoxFit.contain),
                      Text('BoxFit.contain', textAlign: TextAlign.left),
                    ],
                  ),
                  Row(
                    children: [
                      Image(
                          image: AssetImage("images/test.jpeg"),
                          width: 100,
                          height: 100,
                          fit: BoxFit.fill),
                      Text('BoxFit.fill', textAlign: TextAlign.left),
                    ],
                  ),
                  Row(
                    children: [
                      Image(
                          image: AssetImage("images/test.jpeg"),
                          width: 100,
                          height: 100,
                          fit: BoxFit.scaleDown),
                      Text(
                        'BoxFit.scaleDown',
                        textAlign: TextAlign.left,
                      ),
                    ],
                  ),
                  Text('ICON', style: TextStyle(fontSize: 30)),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Icon(Icons.accessible, color: Colors.green),
                      Icon(Icons.error, color: Colors.green),
                      Icon(Icons.fingerprint, color: Colors.green),
                    ],
                  ),
                  Text('自定义ICON', style: TextStyle(fontSize: 30)),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: <Widget>[
                      Icon(
                        new IconData(0xe7ae,
                            fontFamily: 'my', matchTextDirection: true),
                        color: Colors.green,
                        size: 50,
                      ),
                      Icon(
                        new IconData(0xe7ce,
                            fontFamily: 'my', matchTextDirection: true),
                        color: Colors.green,
                        size: 50,
                      ),
                    ],
                  ),
                ],
              ),
            ),
          ],
        ));
  }
}
